import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * Date: 2023-05-30
 * Time: 11:53
 */
class Person implements Cloneable{
    @Override
    protected Object clone() throws CloneNotSupportedException {
        return super.clone();
    }
}
public class Test {
    public static void test1(int[] a) throws CloneNotSupportedException {
        if(a == null){
            throw new CloneNotSupportedException();
        }
    }
    public static void main(String[] args){
        try{
            //存放可能抛出异常的代码
            //test1(null);
            int[] array = {1,2,3};
            System.out.println(array[10]);
        }catch (ArithmeticException e){
            e.printStackTrace();
            System.out.println("捕捉到了 ArithmeticException 异常，进行处理异常的逻辑");
        }catch (NullPointerException e){
            System.out.println("捕捉到了 NullPointerException 异常");;
        }finally {
            System.out.println("finally.......");
        }
        System.out.println("正常的逻辑");
    }
    public static void func(){
        func();
    }

    public static void main4(String[] args) {
        func();
    }
    public static void main5(String[] args) throws CloneNotSupportedException {
        Person person = new Person();
        Person person1 = (Person) person.clone();
    }
    public static void main3(String[] args) {
        int[] array = null;
        System.out.println(array[10]);
    }
    public static void main2(String[] args) {
        int[] array = null;
        System.out.println(array.length);
    }
    public static void main1(String[] args) {
        System.out.println(10/0);
    }
}
